﻿import React, {Component} from 'react';
import {Input, Button} from 'antd';
import './Search.scss';

const {Search} = Input;

class MySearch extends Component {
  mySearch = value => {
    this.props.search(value);
  };

  render() {
    return (
      <div className={'mySearch'}>
        <Search
          value={this.props.searchValue}
          onChange={e => this.props.changeSearchValue(e.target.value)}
          placeholder="请输入..."
          onSearch={value => this.mySearch(value)}
          style={{width: 200}}
        />
        <Button onClick={this.props.clearSearch} style={{marginLeft: 10}}>清除搜索</Button>
      </div>
    );
  }
}

export default MySearch;